package  {

    import flash.utils.IExternalizable;
    import flash.utils.IDataInput;
    import flash.utils.IDataOutput;

    [Bindable]
    [RemoteClass(alias="MyClass")]
    public class MyClass implements IExternalizable {
        public function MyClass(name:String=null) {
            this.name = name;
        }

        public var name:String;
        public var properties:Object;
        //public var price:Number;

        public function readExternal(input:IDataInput):void {
            name = input.readUTF();
            properties = input.readObject();
            //price = input.readFloat();
        }

        public function writeExternal(output:IDataOutput):void {
            output.writeUTF(name);
            output.writeObject(properties);
           // output.writeFloat(price);
        }

        public function toString():String{
            var str:String=
                "name: " + name + "\n"
                +  "\n"

                for  (var n:String in properties){
                    str+= "properties[" + n + "]: " + properties[n].toString() + "\n"
                }

            return str;
        }
    }
}